package edu.xidian.bdilab.jrbigdata.service.enterprise.infoModification.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import edu.xidian.bdilab.jrbigdata.domain.EnterpriseInfo;
import edu.xidian.bdilab.jrbigdata.mapper.EnterpriseInfoMapper;
import edu.xidian.bdilab.jrbigdata.service.enterprise.infoModification.InfoModService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * @ClassName InfoModServiceImpl
 * @Description TODO
 * @Author tuantuan
 * @Date 2019/4/4 上午10:11
 * @Version 1.0
 * @Attention Copyright (C), 2004-2019, BDILab, XiDian University
 **/
@Service
public class InfoModServiceImpl implements InfoModService {
    @Autowired
    EnterpriseInfoMapper enterpriseInfoMapper;


    @Override
    public EnterpriseInfo checkInfoById(String socialCode) {
        QueryWrapper<EnterpriseInfo> queryWrapper = new QueryWrapper<>();

        EnterpriseInfo enterpriseInfo;
        queryWrapper.eq("social_code",socialCode);
        enterpriseInfo = enterpriseInfoMapper.selectOne(queryWrapper);
        return enterpriseInfo;
    }

    @Override
    public void modifyInfo(EnterpriseInfo enterpriseInfo) {
        enterpriseInfoMapper.updateById(enterpriseInfo);
    }
}
